Data Structures

Why learn Data Structures and Algorithms in brief? | Data Structures Tutorial

Why learn Data Structures and Algorithms in brief? | Data Structures Tutorial

Why learn Data Structures and Algorithms in brief? | Data Structures Tutorial

In this article, you will learn why Data Structures and Algorithms are important to learn for every programmer. This article will give you a brief overview of the beginners who are wondering why it is important for them to learn Data Structures and Algorithms. 

What are Algorithms?

Algorithms are a way of writing step-wise instructions on how to solve a problem. They are more of a solution. 

For example, an algorithm to find the prime number

  1. Start
  2. Take input as num 
  3. Initialize a variable flag as true.
  4. If num is 0 then print num is not a prime number.
  5. If num is 2 then print num is a prime number.
  6. Take for loop from 2 to num
    1. If num is divided by any other number except 1 and the number itself i.e it is a prime number.
    2. If num is divided by another number except for 1 and number itself i.e it is not a prime number.
  7. End

In the above example, the algorithm of how to find a prime number is written in English. If it is written in any programming language then it is known as code. 

Reasons to use Data Structure and Algorithms:

  • To make the code scalable: The two most important resources for a computer program are time and memory. The time taken by the computer to run code is: 

Time = number of instructions * time to execute each instruction.

The number of instructions on the code depends on you and the time taken to execute each instruction depends on your machine and compiler. It makes the code more organized.

  • More on scalability: It means we can make the program/system handle the problem of a larger size. If you write the program only for 100 users, you can expand easily with the help of data structures. The basic need to expand the memory and size of the input in the program.
  • Memory is very expensive: It is also not convenient to expand the memory. When we are dealing with code/system which requires you to store a lot of data, it is not always possible to store the data in the memory whenever possible.
Yamini  Sharma

I am working as a professional engineer in "HIghRadius Technologies Pvt. Ltd." Passionate about learning and exploring new technologies. Enthusiast in writing and sharing what I have in my knowledge bucket.